package com.itheima.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * @version v1.0
 * @date 2019/10/16 17:04
 * @description TODO
 **/
@RestController
@RequestMapping
public class HelloController {

    @PreAuthorize("hasRole('ROLE_ADMIN')")
    @RequestMapping("add")
    public String add() {
        System.out.println("add============");
        return null;
    }

    @PreAuthorize("hasRole('DEL')")
    @RequestMapping("delete")
    public String delete() {
        System.out.println("delete===========");
        return null;
    }
}